<template>
  <!--          edit Employee dialogue     *************************************** -->
  <el-dialog
    :title="editEmployeeRemark.title"
    :visible="isVisible"
    :before-close="hide"
  >
    <el-form
      ref="editEmployeeValue"
      :model="editEmployeeValue"
      label-width="120px"
    >
      <el-form-item :label="editEmployeeRemark.rolename">
        <el-select
          v-model="editEmployeeValue.rolename"
          :placeholder="editEmployeeRemark.rolenameOptions[0].label"
        >
          <el-option
            v-for="item in editEmployeeRemark.rolenameOptions"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="editEmployee">确认</el-button>
        <el-button @click="hide">取消</el-button>
      </el-form-item>
    </el-form>
  </el-dialog>
</template>
<script>
export default {
  props: {
    isVisible: {
      type: Boolean,
      required: false,
      default: false,
    },
  },
  data() {
    return {
      editEmployeeValue: {
        rolename: "",
      },
      editEmployeeRemark: {
        rolename: "身份角色",
        rolenameOptions: [
          {
            label: "经理",
            value: "Manager",
          },
          {
            label: "柜台",
            value: "Counter",
          },
          {
            label: "用户",
            value: "User",
          },
        ],
      },
    };
  },
  editd() {},
  methods: {
    editEmployee() {
      this.$message.success("修改成功！！");
      this.$emit("hide");
    },
    hide() {
      this.$emit("hide");
    },
  },
};
</script>